import pickle
import time
import datetime


def get_detail_info(doc_output):
    #doc_output={'588780':4.87}
    path = "data/data_clean_key_cut/"
    print(doc_output)
    print("testkkkk")
    doc_detail_dic=[]
    for key,value in doc_output.items():
        doc_detail = {}
        print(key)
        key_path=path+str(key)
        f1 = open(key_path, 'rb')
        doc = pickle.load(f1)
        print(doc)
        print("标题：", end=" ")
        print(doc['title'])

        doc_detail['title'] = doc['title']
        doc_detail['time'] = doc['time']
        doc_detail['url'] = doc['url']
        doc_detail['rele'] = value

        doc_detail_dic.append(doc_detail)


    return doc_detail_dic




    #path = "data/all_key_words_list_add_syn_extend"


    '''
    time=''
    time=doc['time']
    print(time)
    now = datetime.datetime.now()
    three_days_ago = now + datetime.timedelta(days=-3)
    three_weeks_ago = now + datetime.timedelta(weeks=-3)
    time=datetime.datetime.strptime(time,'%Y-%m-%d %H:%M:%S')

    print(now)  # datetime.datetime(2016, 12, 22, 11, 24, 49, 987171)
    print(three_days_ago)  # datetime.datetime(2016, 12, 19, 11, 24, 49, 987171)
    print(three_weeks_ago)  # datetime.datetime(2016, 12, 1, 11, 24, 49, 987171)
    print(three_days_ago>time)

'''